<!--$Id: db_dump.so,v 10.35 2007/10/26 15:02:55 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: db_dump</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td>
<b>db_dump</b>
</td>
</tr></table>
<hr size=1 noshade>
<tt>
<b><pre>db_dump [<b>-klNpRrV</b>] [<b>-d ahr</b>]
	[<b>-f output</b>] [<b>-h home</b>] [<b>-P password</b>] [<b>-s database</b>] file
db_dump185 [<b>-p</b>] [<b>-f output</b>] file</pre></b>
<b>Description</b>
<a name="2"><!--meow--></a>
<p>The db_dump utility reads the database file <b>file</b> and
writes it to the standard output using a portable flat-text format
understood by the <a href="../utility/db_load.html">db_load</a> utility.  The <b>file</b> argument
must be a file produced using the Berkeley DB library functions.</p>
<p>The <a href="../utility/db_dump.html">db_dump185</a> utility is similar to the db_dump utility,
except that it reads databases in the format used by Berkeley DB versions 1.85
and 1.86.</p>
<p>The options are as follows:</p>
<br>
<b>-d</b><ul compact><li>Dump the specified database in a format helpful for debugging the Berkeley DB
library routines.
<br>
<b>a</b><ul compact><li>Display all information.</ul>
<b>h</b><ul compact><li>Display only page headers.</ul>
<b>r</b><ul compact><li>Do not display the free-list or pages on the free list.  This
mode is used by the recovery tests.</ul>
<br>
<p><b>The output format of the <b>-d</b> option is not standard and may change,
without notice, between releases of the Berkeley DB library.</b></p></ul>
<b>-f</b><ul compact><li>Write to the specified <b>file</b> instead of to the standard output.</ul>
<b>-h</b><ul compact><li>Specify a home directory for the database environment; by
default, the current working directory is used.</ul>
<b>-k</b><ul compact><li>Dump record numbers from Queue and Recno databases as keys.</ul>
<b>-l</b><ul compact><li>List the databases stored in the file.</ul>
<b>-N</b><ul compact><li>Do not acquire shared region mutexes while running.  Other problems,
such as potentially fatal errors in Berkeley DB, will be ignored as well.
This option is intended only for debugging errors, and should not be
used under any other circumstances.</ul>
<b>-P</b><ul compact><li>Specify an environment password.  Although Berkeley DB utilities overwrite
password strings as soon as possible, be aware there may be a window of
vulnerability on systems where unprivileged users can see command-line
arguments or where utilities are not able to overwrite the memory
containing the command-line arguments.</ul>
<b>-p</b><ul compact><li>If characters in either the key or data items are printing characters (as
defined by <b>isprint</b>(3)), use printing characters in <b>file</b>
to represent them.  This option permits users to use standard text editors
and tools to modify the contents of databases.
<p>Note: different systems may have different notions about what characters
are considered <i>printing characters</i>, and databases dumped in
this manner may be less portable to external systems.</p></ul>
<b>-R</b><ul compact><li>Aggressively salvage data from a possibly corrupt file.  The <b>-R</b>
flag differs from the <b>-r</b> option in that it will return all
possible data from the file at the risk of also returning already deleted
or otherwise nonsensical items.  Data dumped in this fashion will almost
certainly have to be edited by hand or other means before the data is
ready for reload into another database</ul>
<b>-r</b><ul compact><li>Salvage data from a possibly corrupt file.  When used on a uncorrupted
database, this option should return equivalent data to a normal dump, but
most likely in a different order.</ul>
<b>-s</b><ul compact><li>Specify a single database to dump.  If no database is specified, all
databases in the database file are dumped.</ul>
<b>-V</b><ul compact><li>Write the library version number to the standard output, and exit.</ul>
<br>
<p>Dumping and reloading Hash databases that use user-defined hash
functions will result in new databases that use the default hash
function.  Although using the default hash function may not be optimal
for the new database, it will continue to work correctly.</p>
<p>Dumping and reloading Btree databases that use user-defined prefix or
comparison functions will result in new databases that use the default
prefix and comparison functions.
<b>In this case, it is quite likely that the database will be damaged
beyond repair permitting neither record storage or retrieval.</b></p>
<p>The only available workaround for either case is to modify the sources
for the <a href="../utility/db_load.html">db_load</a> utility to load the database using the correct
hash, prefix, and comparison functions.</p>
<p>The <a href="../utility/db_dump.html">db_dump185</a> utility may not be available on your system
because it is not always built when the Berkeley DB libraries and utilities
are installed.  If you are unable to find it, see your system
administrator for further information.</p>
<p>The db_dump and <a href="../utility/db_dump.html">db_dump185</a> utility output formats are
documented in the <a href="../ref/dumpload/format.html">Dump Output
Formats</a> section of the Berkeley DB Reference Guide.</p>
<p>The db_dump utility may be used with a Berkeley DB environment (as described for the
<b>-h</b> option, the environment variable <b>DB_HOME</b>, or
because the utility was run in a directory containing a Berkeley DB
environment).  In order to avoid environment corruption when using a
Berkeley DB environment, db_dump should always be given the chance to
detach from the environment and exit gracefully.  To cause db_dump
to release all environment resources and exit cleanly, send it an
interrupt signal (SIGINT).</p>
<p>Even when using a Berkeley DB database environment, the db_dump
utility does not use any kind of database locking if it is invoked with
the <b>-d</b>, <b>-R</b>, or <b>-r</b> arguments.   If used with
one of these arguments, the db_dump utility may only be safely
run on databases that are not being modified by any other process;
otherwise, the output may be corrupt.</p>
<p>The db_dump utility exits 0 on success, and &gt;0 if an error occurs.</p>
<p>The <a href="../utility/db_dump.html">db_dump185</a> utility exits 0 on success, and &gt;0 if an error occurs.</p>
<br><b>Environment Variables</b>
<br>
<b>DB_HOME</b><ul compact><li>If the <b>-h</b> option is not specified and the environment variable
DB_HOME is set, it is used as the path of the database home, as described
in <a href="../api_c/env_open.html">DB_ENV-&gt;open</a>.</ul>
<br>
</tt>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>
